/* Do not change the position of tailwindcss import to ensure css cascade layer order  */
@import 'tailwindcss' source('../../../src');
@import '@fortawesome/fontawesome-svg-core/styles.css' layer(base);
@import 'codemirror/addon/dialog/dialog.css' layer(base);
@import 'codemirror/addon/fold/foldgutter.css' layer(base);
@import 'codemirror/addon/hint/show-hint.css' layer(base);
@import 'codemirror/addon/search/matchesonscrollbar.css' layer(base);
@import 'codemirror/addon/lint/lint.css' layer(base);
@import 'codemirror/lib/codemirror.css' layer(base);
/* used by merge-editor */
@import 'codemirror/addon/merge/merge.css' layer(base);
@import 'codemirror/theme/base16-dark.css' layer(base);
@import './lib/codemirror/merge-dark.css' layer(base);

@import './lib/codemirror/codemirror.css' layer(base);
@import './lib/codemirror/material.css' layer(base);
@import 'monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css' layer(base);
@import './main.css' layer(base);

@plugin '@tailwindcss/typography';

@theme {
  --animate-text-slide-4: text-slide-4 7s cubic-bezier(0.83, 0, 0.17, 1) infinite;
  --animate-up-loop: up-loop 1s linear infinite;
  --animate-down-loop: down-loop 1s linear infinite;

  @keyframes text-slide-4 {
    0%,
    20% {
      transform: translateY(0%);
    }
    25%,
    45% {
      transform: translateY(-20%);
    }
    50%,
    70% {
      transform: translateY(-40%);
    }
    75%,
    95% {
      transform: translateY(-60%);
    }
    100% {
      transform: translateY(-80%);
    }
  }
  @keyframes up-loop {
    0% {
      transform: translateY(10px);
      opacity: 0;
    }
    20% {
      opacity: 1;
    }
    80% {
      opacity: 1;
    }
    100% {
      transform: translateY(-10px);
      opacity: 0;
    }
  }
  @keyframes down-loop {
    0% {
      transform: translateY(-10px);
      opacity: 0;
    }
    20% {
      opacity: 1;
    }
    80% {
      opacity: 1;
    }
    100% {
      transform: translateY(10px);
      opacity: 0;
    }
  }
}

html {
  font-size: 11px;
}

.grid-template-app-layout {
  grid-template:
    'Header Header' auto
    'Content Content' 1fr
    'Statusbar Statusbar' 30px [row-end]
    / 50px 1fr;

  &.with-banner {
    grid-template:
      'Header Header' auto
      'Banner Banner' 30px
      'Content Content' 1fr
      'Statusbar Statusbar' 30px [row-end]
      / 50px 1fr;

    &.with-navbar {
      grid-template:
        'Header Header' auto
        'Banner Banner' 30px
        'Navbar Content' 1fr
        'Statusbar Statusbar' 30px [row-end]
        / 50px 1fr;
    }
  }

  &.with-navbar {
    grid-template:
      'Header Header' auto
      'Navbar Content' 1fr
      'Statusbar Statusbar' 30px [row-end]
      / 50px 1fr;
  }
}

input[type='search']::-webkit-search-cancel-button {
  display: none;
}

input[type='color'] {
  -webkit-appearance: none;
  border: none;
  width: 12px;
  height: 12px;
}
input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type='color']::-webkit-color-swatch {
  border-radius: 9999px;
  border: none;
}

.new-sidebar {
  z-index: 0;
}
.new-sidebar .sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background-color: var(--color-bg);
  color: var(--color-font);
  overflow: hidden;
}

table.json-diff-viewer {
  colgroup {
    width: 100%;

    col {
      width: 50%;
    }
  }

  td {
    padding: 1px 4px;
    font-size: 0;
  }

  tr {
    vertical-align: top;

    .line-remove {
      background: rgba(var(--color-danger-rgb), 0.2);
      color: var(--color-font);
    }

    .line-add {
      background: rgba(var(--color-success-rgb), 0.2);
      color: var(--color-font);
    }

    .line-modify {
      background: rgba(var(--color-warning-rgb), 0.2);
      color: var(--color-font);
    }

    &.expand-line {
      text-align: center;

      button {
        margin: 0 0.5em;
        padding: 0;
        color: var(--color-font);
        font-size: 12px;
        border: none;
        background: transparent;
        user-select: none;
        cursor: pointer;

        &:hover {
          text-decoration: underline;
        }
      }
    }
  }

  pre {
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-all;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.bounce-in {
  animation: bounceIn 350ms ease-in;
}

.monaco-editor .margin {
  margin: 0;
}

::view-transition-new(toast):only-child {
  animation: slideIn 400ms ease-out;
}

::view-transition-old(toast):only-child {
  animation: slideOut 400ms ease-in;
}

@keyframes slideIn {
  from {
    translate: 100% 0;
    opacity: 0;
  }
}
@keyframes slideOut {
  to {
    translate: 100% 0;
    opacity: 0;
  }
}

.CodeMirror-merge {
  height: 100%;
}
.CodeMirror-merge .CodeMirror-merge-pane {
  height: 100%;
}
.CodeMirror-merge .CodeMirror {
  height: 100%;
}
